package com.cd.university.config.security.authentication.util;

/**
 * @author 陈栋
 * @create 2021/9/5 21:25
 */
public class SecurityThreadLocal {
    public static ThreadLocal<ThreadLocalUser> userThreadLocal;

    public static ThreadLocal<String> validateCodeThreadLocal;

    public SecurityThreadLocal() {
    }

    public static ThreadLocal<ThreadLocalUser> getInstance() {
        if (userThreadLocal==null) {
            userThreadLocal = new ThreadLocal<>();
        }
        return userThreadLocal;
    }

    public static ThreadLocal<String> getValidateCodeThreadLocal() {
        if (validateCodeThreadLocal==null) {
            validateCodeThreadLocal = new ThreadLocal<>();
        }

        return validateCodeThreadLocal;
    }


}
